/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.thienloc.omap.entity;

import java.io.Serializable;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author GiangLT
 */
@Entity
@Table(name = "RECVSMS_HIST", catalog = "")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "RecvsmsHist.findAll", query = "SELECT r FROM RecvsmsHist r"),
    @NamedQuery(name = "RecvsmsHist.findByHistoryid", query = "SELECT r FROM RecvsmsHist r WHERE r.historyid = :historyid"),
    @NamedQuery(name = "RecvsmsHist.findByRecvTime", query = "SELECT r FROM RecvsmsHist r WHERE r.recvTime = :recvTime"),
    @NamedQuery(name = "RecvsmsHist.findByRecvTimeRange", query = "SELECT r FROM RecvsmsHist r WHERE r.recvTime BETWEEN :startTime and :endTime"),
    @NamedQuery(name = "RecvsmsHist.findByMsisdn", query = "SELECT r FROM RecvsmsHist r WHERE r.msisdn = :msisdn"),
    @NamedQuery(name = "RecvsmsHist.findByCallbackId", query = "SELECT r FROM RecvsmsHist r WHERE r.callbackId = :callbackId"),
    @NamedQuery(name = "RecvsmsHist.findBySrcaddr", query = "SELECT r FROM RecvsmsHist r WHERE r.srcaddr = :srcaddr"),
    @NamedQuery(name = "RecvsmsHist.findByMessage", query = "SELECT r FROM RecvsmsHist r WHERE r.message = :message"),
    @NamedQuery(name = "RecvsmsHist.findByServicetype", query = "SELECT r FROM RecvsmsHist r WHERE r.servicetype = :servicetype"),
    @NamedQuery(name = "RecvsmsHist.findBySelected", query = "SELECT r FROM RecvsmsHist r WHERE r.selected = :selected"),
    @NamedQuery(name = "RecvsmsHist.findByLastUpdatedTime", query = "SELECT r FROM RecvsmsHist r WHERE r.lastUpdatedTime = :lastUpdatedTime")})
public class RecvsmsHist implements Serializable {
    private static final long serialVersionUID = 1L;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "HISTORYID")
    private BigDecimal historyid;
    @Column(name = "RECV_TIME")
    @Temporal(TemporalType.TIMESTAMP)
    private Date recvTime;
    @Size(max = 15)
    @Column(name = "MSISDN")
    private String msisdn;
    @Size(max = 50)
    @Column(name = "CALLBACK_ID")
    private String callbackId;
    @Size(max = 20)
    @Column(name = "SRCADDR")
    private String srcaddr;
    @Size(max = 350)
    @Column(name = "MESSAGE")
    private String message;
    @Size(max = 20)
    @Column(name = "SERVICETYPE")
    private String servicetype;
    @Column(name = "SELECTED")
    private BigInteger selected;
    @Column(name = "LAST_UPDATED_TIME")
    @Temporal(TemporalType.TIMESTAMP)
    private Date lastUpdatedTime;

    public RecvsmsHist() {
    }

    public RecvsmsHist(BigDecimal historyid) {
        this.historyid = historyid;
    }

    public BigDecimal getHistoryid() {
        return historyid;
    }

    public void setHistoryid(BigDecimal historyid) {
        this.historyid = historyid;
    }

    public Date getRecvTime() {
        return recvTime;
    }

    public void setRecvTime(Date recvTime) {
        this.recvTime = recvTime;
    }

    public String getMsisdn() {
        return msisdn;
    }

    public void setMsisdn(String msisdn) {
        this.msisdn = msisdn;
    }

    public String getCallbackId() {
        return callbackId;
    }

    public void setCallbackId(String callbackId) {
        this.callbackId = callbackId;
    }

    public String getSrcaddr() {
        return srcaddr;
    }

    public void setSrcaddr(String srcaddr) {
        this.srcaddr = srcaddr;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public String getServicetype() {
        return servicetype;
    }

    public void setServicetype(String servicetype) {
        this.servicetype = servicetype;
    }

    public BigInteger getSelected() {
        return selected;
    }

    public void setSelected(BigInteger selected) {
        this.selected = selected;
    }

    public Date getLastUpdatedTime() {
        return lastUpdatedTime;
    }

    public void setLastUpdatedTime(Date lastUpdatedTime) {
        this.lastUpdatedTime = lastUpdatedTime;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (historyid != null ? historyid.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof RecvsmsHist)) {
            return false;
        }
        RecvsmsHist other = (RecvsmsHist) object;
        if ((this.historyid == null && other.historyid != null) || (this.historyid != null && !this.historyid.equals(other.historyid))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.thienloc.omap.entity.RecvsmsHist[ historyid=" + historyid + " ]";
    }
    
}
